<!--新建查询组件-->
<template>
  <div id="select">
    <el-row style="margin: 10px 0px 20px 20px">
      <el-col :span="24">
        <el-form :inline="true" :model="toChildrenData" ref="form">
          <el-form-item style="margin-bottom: 0px" label="连接">
            <el-select v-model="toChildrenData.link" placeholder="请选择连接">
              <el-option label="Mysql" value="Mysql"></el-option>
              <el-option label="Oracle" value="Oracle"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="margin-bottom: 0px" label="库">
            <el-select v-model="toChildrenData.datab" placeholder="请选择库">
              <el-option label="bt" value="bt"></el-option>
              <el-option label="guazi" value="guazi"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item style="margin-bottom: 0px">
            <el-button type="success" icon="el-icon-caret-right" round @click="runSql"></el-button>
          </el-form-item>
          <el-form-item style="margin-bottom: 0px">
            <el-button type="success" icon="el-icon-document" round @click="onSave"></el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-input style="margin: 0px 10px 20px 20px; width: 97%" type="textarea" autosize
              v-model="toChildrenData.sql"></el-input>
  </div>
</template>

<script>
  export default {
    name: "select",
    props: {
      toChildrenData: {
        type: Object
      }
    },
    methods: {
      runSql: function () {
        alert('run sql')
      },
      onSave: function () {
        alert('save sql')
      }
    }
  }
</script>

<style scoped>
  #select {
    width: 100%;
    height: 100%;
  }
</style>
